
case node[:platform]
when "debian", "ubuntu"
    execute 'Setup sources.list' do
        command 'sudo sh -c \'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list\''
    end

    execute 'Setup keys' do
        command 'sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116'
    end

    execute 'Update package list' do
        command 'sudo apt-get update -y'
    end

    package "ros-" + node[:'ros']['distribution'] + "-" + node[:'ros']['install-target'] do
        options "-y"
    end

    execute 'Initialize rosdep' do
        not_if 'test -e /etc/ros/rosdep/sources.list.d/20-default.list'
        command 'sudo rosdep init && rosdep update'
    end

    execute 'Environment setup' do
        add_cmd = "source /opt/ros/%s/setup.bash" % node[:'ros']['distribution']
        not_if 'grep "%s" ~/.bashrc' % add_cmd
        command 'echo "%s" >> ~/.bashrc' % add_cmd
    end

    execute 'Load setup script' do
        command '. /opt/ros/%s/setup.sh' % node[:'ros']['distribution']
    end

when "redhat", "fedora"
    # redhat is including CentOS
    # something

else
    # something
end

